//
//  SEGBasicBussinessCommonDefine.m
//  SEGBasicBussiness
//
//  Created by 刘山 on 2018/3/21.
//  Copyright © 2018年 刘山. All rights reserved.
//

#import "SEGBasicBussinessCommonDefine.h"

#if __has_include(<SEGPlatform/SEGPlatformManager.h>)
#import <SEGPlatform/SEGPlatformManager.h>
#else
#import "SEGPlatformManager.h"
#endif

@implementation SEGBasicBussinessCommonDefine

/// 从plist中读取三方key
/// @param key key
+ (NSString *)readThirdKeyFromPlist:(NSString*)key {
    if (!key || key.length == 0) {
        return @"";
    }
    
    // 读取Plist
    NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"SEGThirdKey" ofType:@"plist"];
    if (plistPath && plistPath.length > 0) {
        NSDictionary *thirdKeyDict = [NSDictionary dictionaryWithContentsOfFile:plistPath];
        if (thirdKeyDict && thirdKeyDict.count > 0 && [thirdKeyDict.allKeys containsObject:key]) {
            return ValueToString(thirdKeyDict[key]);
        }
    }
    return @"";
}

/**
 * 设置不同平台的有赞商城client_id
 * @author Wendy
 */
+(NSString*)segYouZanClient_id{
    return [self readThirdKeyFromPlist:@"YouZanClient_id"];
}

/**
 * 设置不同平台的有赞商城client_secret
 * @author Wendy
 */
+(NSString*)segYouZanClient_secret{
    return [self readThirdKeyFromPlist:@"YouZanClient_secret"];
}

/**
 * 设置不同平台的百度地图服务密钥appkey
 * @author Wendy
 */
+(NSString*)segBaiduMapAppKey{
    return [self readThirdKeyFromPlist:@"BaiduMap"];
}

/**
 * 设置不同平台的友盟统计appkey
 * @author Sam
 */
+(NSString*)segUMengAnalyticsAppKey {
    return [self readThirdKeyFromPlist:@"UMengAnalytics"];
}

/**
 * 设置不同平台的QQ分享appID
 * @author helen
 */
+(NSString*)segQQAppId{
    return [self readThirdKeyFromPlist:@"QQAppID"];
}

/**
 * 设置不同平台的QQ分享appKey    （QQ分享appKey值暂时未用到）
 * @author helen
 */
+(NSString*)segQQAppKey{
    return [self readThirdKeyFromPlist:@"QQAppKey"];
}

/**
 * 设置不同平台的微信分享appkey
 * @author helen
 */
+(NSString*)segWeChatAppId{
    return [self readThirdKeyFromPlist:@"WeChatAppID"];
}

/**
 * 设置不同平台UniversalLink
 * @author helen
 */
+(NSString*)segUniversalLink {
    return [self readThirdKeyFromPlist:@"UniversalLink"];
}

/**
 * 设置不同平台的GDTAppKey
 * @author Helen
 */
+(NSString *)segGDTAppKey{
    return [self readThirdKeyFromPlist:@"GDTAppKey"];
}

/**
 * 设置不同平台的测试极光推送appkey
 * @author helen
 */
+(NSString*)segJPUSHAppTestKey{
    return [self readThirdKeyFromPlist:@"JPUSHTest"];
}

/**
 * 设置不同平台的极光推送appkey  (上架用正式key)
 * @author helen
 */
+(NSString*)segJPUSHAppKey{
    return [self readThirdKeyFromPlist:@"JPUSH"];
}

+ (BOOL)segDebug {
    return NO;
}

@end


@implementation SEGBasicBussinessStringDefine

/// 输入框默认文案
+ (NSString *)inputToolBarDefalutDesc {
    return @"我想说......(140字)";
}

/// 邻里圈发布&评论&活动评论的最大字数
+ (NSInteger)postCommentMaxLength {
    return 140;;
}


// 提示用户认证的文案
+ (NSString *)promptUserAuthentication {
    return @"亲~该功能需物业管理处认证后方可使用";
}
@end
